<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/css/jpetstore.css" type="text/css">
</head>
<body>

    <!--头部引用-->
    <div th:replace="/common/IncludeTop::header"></div>

    <div id="BackLink">
        <a th:href="@{/catalog/viewCategory(categoryId=${product.categoryId})}">categoryId</a>
    </div>

    <div id="Catalog">

        <h2 th:text="product.name">商品的名字</h2>

        <table>
            <tr>
                <th>Item ID</th>
                <th>Product ID</th>
                <th>Description</th>
                <th>List Price</th>
                <th> </th>
            </tr>
            <tr th:each="item:${itemList}">
                <td>
                    <a th:href="@{/catalog/viewItem(itemId=${item.itemId})}" th:text="${item.itemId}">item的id</a>
                </td>
                <td th:text="${product.productId}"></td>
                <td th:text="${item.attribute1}+' '+${item.attribute2}+' '+${item.attribute3}+' '+
                    ${item.attribute4}+' '+${item.attribute5}+' '+${product.name}">
                    ${item.attribute1} ${item.attribute2} ${item.attribute3}
                    ${item.attribute4} ${item.attribute5} ${sessionScope.product.name}
                </td>
                <!--<td th:text="${item.listPrice}"></td>-->
                <td th:text="'$'+${#numbers.formatDecimal(item.listPrice,1,2)}"></td>
                <td th:href="@{#(workingItemId=${item.itemId})}">Add to cart</td>
            </tr>

            <!--<c:forEach var="item" items="${sessionScope.itemList}">
                <tr>
                    <td>
                        <a href="viewItem?itemId=${item.itemId}">${item.itemId}</a>
                    </td>
                    <td>
                        ${item.product.productId}
                    </td>
                    <td>
                        ${item.attribute1} ${item.attribute2} ${item.attribute3}
                        ${item.attribute4} ${item.attribute5} ${sessionScope.product.name}
                    </td>
                    <td><fmt:formatNumber value="${item.listPrice}"
                                          pattern="$#,##0.00" /></td>
                    <td>
                        <a class="Button" href="addItemToCart?workingItemId=${item.itemId}">Add to Cart</a>
                    </td>
                </tr>
            </c:forEach>-->
            <tr>
                <td>
                </td>
            </tr>
        </table>

    </div>

    <!--底部引用-->
    <div th:replace="/common/IncludeBottom::footer"></div>

</body>
</html>